package dao;

import gui.MD5;

import java.sql.Connection;
import java.util.Vector;

import model.Account;

public class DaoImp_LogIn implements IDao_LogIn
{
	private DaoMethod method;
	private Connection conn;

	public DaoImp_LogIn()
	{
		method = new DaoMethod();
		conn = DaoMethod.getConnection();
	}

	public Vector<Vector<Object>> login(Account account)
	{
		String exe = "select id from account where username='"
				+ account.getUsername() + "' and password='"
				+ account.getPassword() + "'";
		return method.stQuery(exe);
	}

	public void modifyPassword(Account account, String newPwd)
	{
		String exe = "update account set password='" + newPwd
				+ "' where username='" + account.getUsername() + "'";
		method.stUpdate(exe);
	}
}
